home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / asmutil / 80x0393.zip / FEEP.ASM < prev    next >
Assembly Source File  |  1993-03-30  |  2KB  |  62 lines

  1. ;
  2. ; FEEP  Timer interrupt diagnostic checker.
  3. ;       Beeps while timer interrupt (int 08) is being serviced.
  4. ;       Released to the public domain by Sam Warden 1992/10/13.
  5. ;       TSR.  Source compatible with MS MASM 5.1.
  6. ;
  7. COUNT           EQU     91                  ; = 18.2 x 5 (5 sec. interval)
  8. ;
  9. _TEXT           SEGMENT PARA    PUBLIC  'CODE'
  10.                 ASSUME  cs:_TEXT, ds:_TEXT, es:_TEXT, ss:_TEXT
  11.                 ORG     100h
  12. ;
  13. main:           jmp     SHORT init
  14. ;
  15. counter         DB      COUNT
  16. feeping         DB      0
  17. oldvec          DD      0
  18. ;
  19. handler:                                    ; INT 08 handler
  20.                 pushf                       ; 1st call original handler
  21.                 call    dword ptr cs:oldvec
  22. ;
  23.                 cmp     cs:feeping,1        ; if already feeping
  24.                 jne     feep
  25.                 push    ax
  26.                 in      al,61h              ;   stop
  27.                 and     al,0FCh
  28.                 jmp     SHORT   $ + 2
  29.                 out     61h,al
  30.                 pop     ax
  31.                 mov     cs:feeping,0
  32. feep:
  33.                 dec     cs:counter
  34.                 jnz     go_on               ; if counter = 0
  35.                 mov     cs:counter,COUNT    ;   reset
  36.                 push    ax
  37.                 in      al,61h              ;   and feep
  38.                 or      al,3
  39.                 jmp     SHORT $ + 2
  40.                 out     61h,al
  41.                 pop     ax
  42.                 mov     cs:feeping,1
  43. go_on:          iret
  44. ;
  45. tsr_end         EQU     $
  46. ;
  47. init:           mov     es,ds:[002Ch]       ; get pointer to env. from PSP
  48.                 mov     ah,49h              ; release environment memory
  49.                 int     21h
  50.                 mov     ax,3508h            ; get timer interrupt vector
  51.                 int     21h                 ;   in es:bx
  52.                 mov     word ptr oldvec,bx  ;   and store it
  53.                 mov     word ptr oldvec+2,es
  54.                 mov     ax,2508h            ; set new timer vector
  55.                 mov     dx,OFFSET handler
  56.                 int     21h
  57.                 mov     dx,OFFSET tsr_end   ; and go resident
  58.                 int     27h
  59. ;
  60. _TEXT           ENDS
  61.                 END     main
  62.